package com.footballretriever.data;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class PlayerSeason {

	private String player;
	private String team;
	private String season;
	private String championship;
	private String matchTotal;
	private String matchPlayed;
	private String minutePlayed;
	private String minuteTotal;
	private String goal;
	private String substitutionDone;
	private String substitutionHaved;
	private String yellowCard;
	private String redCard;
	private String disqualification;
	
	public PlayerSeason(String player) {
		
		this.player = player;
		
	}
	
	public PlayerSeason(String player, String team, String season, String championship, String matchTotal, String matchPlayed,
			String minutePlayed, String minuteTotal, String goal, String substitutionDone, String substitutionHaved, String yellowCard, String redCard, String disqualification) {
		
		this.setPlayer(player);
		this.setTeam(team);
		this.setSeason(season);
		this.setChampionship(championship);
		this.setMatchTotal(matchTotal);
		this.setMatchPlayed(matchPlayed);
		this.setMinutePlayed(minutePlayed);
		this.setMinuteTotal(minuteTotal);
		this.setGoal(goal);
		this.setSubstitutionDone(substitutionDone);
		this.setSubstitutionHaved(substitutionHaved);
		this.setYellowCard(yellowCard);
		this.setRedCard(redCard);
		this.setDisqualification(disqualification);
		
	}

	public String getPlayer() {
		return player;
	}

	public void setPlayer(String player) {
		this.player = player;
	}

	public String getTeam() {
		return team;
	}

	public void setTeam(String team) {
		this.team = team;
	}

	public String getSeason() {
		return season;
	}

	public void setSeason(String season) {
		this.season = season;
	}

	public String getChampionship() {
		return championship;
	}

	public void setChampionship(String championship) {
		this.championship = championship;
	}

	public String getMatchTotal() {
		return matchTotal;
	}

	public void setMatchTotal(String matchTotal) {
		this.matchTotal = matchTotal;
	}

	public String getMatchPlayed() {
		return matchPlayed;
	}

	public void setMatchPlayed(String matchPlayed) {
		this.matchPlayed = matchPlayed;
	}

	public String getMinutePlayed() {
		return minutePlayed;
	}

	public void setMinutePlayed(String minutePlayed) {
		this.minutePlayed = minutePlayed;
	}

	public String getMinuteTotal() {
		return minuteTotal;
	}

	public void setMinuteTotal(String minuteTotal) {
		this.minuteTotal = minuteTotal;
	}

	public String getGoal() {
		return goal;
	}

	public void setGoal(String goal) {
		this.goal = goal;
	}

	public String getSubstitutionDone() {
		return substitutionDone;
	}

	public void setSubstitutionDone(String substitutionDone) {
		this.substitutionDone = substitutionDone;
	}

	public String getSubstitutionHaved() {
		return substitutionHaved;
	}

	public void setSubstitutionHaved(String substitutionHaved) {
		this.substitutionHaved = substitutionHaved;
	}

	public String getYellowCard() {
		return yellowCard;
	}

	public void setYellowCard(String yellowCard) {
		this.yellowCard = yellowCard;
	}

	public String getRedCard() {
		return redCard;
	}

	public void setRedCard(String redCard) {
		this.redCard = redCard;
	}

	public String getDisqualification() {
		return disqualification;
	}

	public void setDisqualification(String disqualification) {
		this.disqualification = disqualification;
	}
	
	public String toString() {
		
		String toString = "";
        Method[] methods = this.getClass().getMethods();
        
        for (Method method : methods) {
        	
            if(method.getName().startsWith("get")) {
            	
                try {
                	
					toString = toString + method.getName() + " -> " + method.invoke(this, null) + "\n";
					
				} catch (IllegalAccessException | IllegalArgumentException	| InvocationTargetException e) {
					
					e.printStackTrace();
					
				}
            }
        }
        
        return toString;
        
    }

}
